<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>    
  th{width:100px; text-align:center;}
  td{width:100px; text-align:center;}
</style>
</head>
<body>
	<h3>登录成功</h3>
	<hr/>
   <table align="center" border=3>
	 <caption align="centere"><font size="5" color="red">今天是：${date}</font></caption>
     <tr>
        <th>日</th><th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th>六</th>
     </tr>
     <tbody>
     	<%	
     		int first=(Integer)request.getAttribute("firstDay");
     		int last=(Integer)request.getAttribute("lastDay");
     		List<Integer> list=(List)request.getAttribute("list");
     		int num=0;
     		int m=0,n=0;
     		
     		for(int i = 1; i <= last; i++){
     			if(i==1){
     				out.print("<tr>");
     				if (first!=1){
    			        for (int j = 0; j < first-1; j++) {
    			            out.print("<td></td>");
    			            num++;
    			        }
    			    }
     			}
     			if(num==7){
     				out.print("<tr>");
     				num=0;
     			}
		     	
     			//判断是否签到
     			if(m<list.size()){
     				n=list.get(m);
     			}
		     	if(i==n && m<list.size()){
		     		out.print("<td bgcolor='blue'>"+i+"</td>");
			     	num++;
			     	m++;
		     	}else{
		     		out.print("<td>"+i+"</td>");
			     	num++;
		     	}
			     	
		     	if(num==7){
		     		out.print("</tr>");
		     	}
     		}
     	%>
     </tbody>
</body>
</html>